* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: #f5f7fa;
    color: #1a1a2e;
    min-height: 100vh;
}

.main-content {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.auth-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: linear-gradient(135deg, #0D9488 0%, #0F766E 100%);
    min-height: 100vh;
}

.auth-card {
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    padding: 40px 36px;
    width: 100%;
    max-width: 420px;
}

.auth-card.register-card {
    max-width: 600px;
    padding: 36px;
}

.auth-card h1 {
    font-size: 28px;
    font-weight: 700;
    color: #0D9488;
    text-align: center;
    margin-bottom: 4px;
}

.auth-card .subtitle {
    text-align: center;
    color: #64748b;
    font-size: 14px;
    margin-bottom: 28px;
}

.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #334155;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group input[type="number"] {
    width: 100%;
    padding: 12px 14px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 15px;
    font-family: inherit;
    color: #1e293b;
    background: #fff;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group input:focus {
    outline: none;
    border-color: #0D9488;
    box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.12);
}

.form-group input::placeholder {
    color: #94a3b8;
}

.form-group input[type="file"] {
    width: 100%;
    padding: 10px;
    border: 2px dashed #cbd5e1;
    border-radius: 10px;
    font-size: 14px;
    font-family: inherit;
    background: #f8fafc;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
}

.form-group input[type="file"]:hover {
    border-color: #0D9488;
    background: #f0fdfa;
}

.checkbox-group {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 22px;
}

.checkbox-group input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #0D9488;
    cursor: pointer;
}

.checkbox-group label {
    font-size: 14px;
    color: #475569;
    cursor: pointer;
    user-select: none;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 13px 24px;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s, box-shadow 0.2s;
    text-decoration: none;
}

.btn:active {
    transform: scale(0.98);
}

.btn-primary {
    background: #0D9488;
    color: #fff;
    width: 100%;
}

.btn-primary:hover {
    background: #0F766E;
    box-shadow: 0 4px 12px rgba(13, 148, 136, 0.35);
}

.btn-secondary {
    background: #f1f5f9;
    color: #475569;
    width: 100%;
}

.btn-secondary:hover {
    background: #e2e8f0;
}

.btn-add {
    background: #f0fdf4;
    color: #15803d;
    font-size: 13px;
    font-weight: 600;
    padding: 8px 16px;
    border-radius: 8px;
    border: 1px dashed #86efac;
}

.btn-add:hover {
    background: #dcfce7;
    border-color: #4ade80;
}

.btn-remove {
    background: #fef2f2;
    color: #dc2626;
    font-size: 13px;
    padding: 6px 10px;
    border-radius: 8px;
    border: none;
    min-width: 32px;
    height: 32px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-remove:hover {
    background: #fee2e2;
}

.auth-links {
    text-align: center;
    margin-top: 22px;
}

.auth-links a {
    color: #0D9488;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: color 0.2s;
}

.auth-links a:hover {
    color: #0F766E;
    text-decoration: underline;
}

.alert {
    padding: 12px 16px;
    border-radius: 10px;
    margin-bottom: 20px;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.4;
}

.alert-error {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
}

.alert-success {
    background: #f0fdf4;
    color: #15803d;
    border: 1px solid #bbf7d0;
}

.dynamic-section {
    margin-bottom: 24px;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 20px;
    background: #fafbfc;
}

.dynamic-section h3 {
    font-size: 15px;
    font-weight: 600;
    color: #0D9488;
    margin-bottom: 4px;
}

.dynamic-section .section-desc {
    font-size: 12px;
    color: #94a3b8;
    margin-bottom: 14px;
}

.dynamic-items {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 12px;
}

.dynamic-item {
    display: flex;
    gap: 8px;
    align-items: flex-start;
}

.dynamic-item .form-group {
    flex: 1;
    margin-bottom: 0;
}

.dynamic-item .form-group input {
    padding: 10px 12px;
    font-size: 14px;
}

.cartao-item {
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 16px;
    background: #fff;
}

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

.cartao-item .form-row .form-group:first-child {
    grid-column: 1 / -1;
}

.radio-group {
    display: flex;
    gap: 24px;
    margin-top: 8px;
}

.radio-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 500;
    color: #334155;
    cursor: pointer;
    user-select: none;
}

.radio-group input[type="radio"] {
    width: 18px;
    height: 18px;
    accent-color: #0D9488;
    cursor: pointer;
}

.alternativa-section {
    border: 1px solid #99f6e4;
    border-radius: 14px;
    padding: 20px;
    background: #f0fdfa;
    margin-bottom: 24px;
}

.alternativa-section h3 {
    font-size: 15px;
    font-weight: 600;
    color: #0D9488;
    margin-bottom: 4px;
}

.alternativa-section .section-desc {
    font-size: 12px;
    color: #64748b;
    margin-bottom: 16px;
}

.section-divider {
    border: none;
    border-top: 1px solid #e2e8f0;
    margin: 28px 0 24px;
}

.buttons-row {
    display: flex;
    gap: 12px;
    margin-top: 10px;
}

.buttons-row .btn {
    flex: 1;
}

.buttons-row .btn-primary {
    width: auto;
}

.buttons-row .btn-secondary {
    width: auto;
}

.hint {
    font-size: 11px;
    color: #94a3b8;
    margin-top: 4px;
    letter-spacing: 0.2px;
}

.photo-preview {
    margin-bottom: 12px;
    display: none;
}

.photo-preview img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #0D9488;
}

.header {
    background: #fff;
    padding: 14px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #e2e8f0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

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

.btn-back {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    color: #64748b;
    text-decoration: none;
    font-size: 16px;
    transition: background 0.2s, color 0.2s;
    flex-shrink: 0;
}

.btn-back:hover {
    background: #f1f5f9;
    color: #0D9488;
}

.header-greeting {
    font-size: 15px;
    font-weight: 600;
    color: #1e293b;
}

.profile-mini-img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
}

.profile-mini-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #0D9488;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
}

.dropdown {
    position: relative;
}

.dropdown-toggle {
    background: none;
    border: none;
    font-size: 20px;
    color: #64748b;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: background 0.2s;
}

.dropdown-toggle:hover {
    background: #f1f5f9;
}

.dropdown-menu {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.12);
    min-width: 200px;
    padding: 6px;
    z-index: 200;
}

.dropdown-menu.show {
    display: block;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    color: #334155;
    text-decoration: none;
    font-size: 14px;
    border-radius: 8px;
    transition: background 0.2s;
}

.dropdown-item:hover {
    background: #f1f5f9;
}

.dropdown-item i {
    width: 18px;
    text-align: center;
    color: #64748b;
}

.dropdown-divider {
    height: 1px;
    background: #e2e8f0;
    margin: 4px 8px;
}

.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #fff;
    display: flex;
    border-top: 1px solid #e2e8f0;
    padding: 6px 0;
    padding-bottom: env(safe-area-inset-bottom, 6px);
    z-index: 100;
}

.bottom-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 6px;
    color: #94a3b8;
    text-decoration: none;
    font-size: 10px;
    font-weight: 500;
    transition: color 0.2s;
}

.bottom-nav-item i {
    font-size: 20px;
}

.bottom-nav-item.active,
.bottom-nav-item:hover {
    color: #0D9488;
}

.home-container {
    flex: 1;
    padding: 20px;
    padding-bottom: 80px;
    background: #fff;
    min-height: 100vh;
}

.section-title {
    font-size: 18px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 16px;
}

.search-bar {
    margin-bottom: 20px;
}

.search-bar form {
    display: flex;
    align-items: center;
    background: #f1f5f9;
    border-radius: 12px;
    padding: 0 14px;
    border: 2px solid transparent;
    transition: border-color 0.2s, background 0.2s;
}

.search-bar form:focus-within {
    border-color: #0D9488;
    background: #fff;
}

.search-bar .search-icon {
    color: #94a3b8;
    font-size: 16px;
    margin-right: 10px;
}

.search-bar input[type="text"] {
    flex: 1;
    border: none;
    background: transparent;
    padding: 12px 0;
    font-size: 15px;
    font-family: inherit;
    color: #1e293b;
    outline: none;
}

.search-bar input[type="text"]::placeholder {
    color: #94a3b8;
}

.search-clear {
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    padding: 8px;
    font-size: 14px;
}

.search-results {
    margin-bottom: 20px;
}

.search-results-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    font-size: 14px;
    color: #64748b;
}

.search-results-header .btn-delete {
    background: #fef2f2;
    color: #dc2626;
    border: none;
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.search-results-header .btn-delete:hover {
    background: #fee2e2;
}

.transaction-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.transaction-item {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #f8fafc;
    border-radius: 12px;
    padding: 14px 16px;
    border: 1px solid #f1f5f9;
    transition: box-shadow 0.2s;
}

.transaction-item:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.transaction-checkbox {
    display: flex;
    align-items: center;
}

.transaction-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #0D9488;
    cursor: pointer;
}

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

.transaction-main {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.transaction-desc {
    font-weight: 600;
    font-size: 14px;
    color: #1e293b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.transaction-cat {
    font-size: 11px;
    color: #94a3b8;
    background: #f1f5f9;
    padding: 2px 8px;
    border-radius: 6px;
    white-space: nowrap;
}

.transaction-meta {
    display: flex;
    align-items: center;
    gap: 16px;
}

.transaction-value {
    font-weight: 700;
    font-size: 15px;
    color: #1e293b;
}

.transaction-value.value-receita {
    color: #16a34a;
}

.transaction-value.value-despesa {
    color: #dc2626;
}

.transaction-date {
    font-size: 13px;
    color: #94a3b8;
}

.transaction-date i {
    margin-right: 4px;
}

.transaction-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

.btn-action {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 10px;
    border: none;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    white-space: nowrap;
}

.btn-show {
    background: #ecfdf5;
    color: #0D9488;
}

.btn-show:hover {
    background: #d1fae5;
}

.btn-edit {
    background: #eff6ff;
    color: #2563eb;
}

.btn-edit:hover {
    background: #dbeafe;
}

.btn-delete {
    background: #fef2f2;
    color: #dc2626;
}

.btn-delete:hover {
    background: #fee2e2;
}

.search-item-delete {
    padding: 8px 12px;
    font-size: 14px;
}

.empty-state {
    text-align: center;
    padding: 48px 20px;
    color: #94a3b8;
}

.empty-state i {
    font-size: 48px;
    margin-bottom: 16px;
    color: #cbd5e1;
}

.empty-state p {
    font-size: 15px;
    margin-bottom: 20px;
}

.empty-state .btn {
    width: auto;
    display: inline-flex;
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: #fff;
    border-radius: 20px;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}

.modal-sm {
    max-width: 400px;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid #f1f5f9;
}

.modal-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: #1e293b;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #94a3b8;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
}

.modal-close:hover {
    color: #475569;
}

.modal-body {
    padding: 24px;
}

.detail-grid {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.detail-field {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.detail-label {
    font-size: 12px;
    font-weight: 600;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.detail-value {
    font-size: 15px;
    color: #1e293b;
}

.badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
}

.badge-receita {
    background: #f0fdf4;
    color: #16a34a;
}

.badge-despesa {
    background: #fef2f2;
    color: #dc2626;
}

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

.page-container {
    flex: 1;
    padding: 20px;
    padding-bottom: 80px;
    background: #f5f7fa;
    min-height: 100vh;
}

.page-card {
    background: #fff;
    border-radius: 16px;
    padding: 28px;
    max-width: 700px;
    margin: 0 auto;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.page-title {
    font-size: 22px;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 24px;
}

.info-section {
    margin-bottom: 24px;
}

.info-section h3 {
    font-size: 14px;
    font-weight: 600;
    color: #0D9488;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-bottom: 12px;
    padding-bottom: 6px;
    border-bottom: 1px solid #f1f5f9;
}

.info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: #f8fafc;
    border-radius: 8px;
    margin-bottom: 6px;
}

.info-label {
    font-weight: 600;
    font-size: 14px;
    color: #334155;
}

.info-value {
    font-size: 13px;
    color: #64748b;
}

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    background: #f1f5f9;
    color: #475569;
}

.tag-custom {
    background: #f0fdfa;
    color: #0D9488;
}

.about-content {
    text-align: center;
}

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

.about-logo i {
    font-size: 48px;
    color: #0D9488;
    margin-bottom: 12px;
}

.about-logo h1 {
    font-size: 24px;
    font-weight: 700;
    color: #0D9488;
}

.about-desc {
    color: #64748b;
    font-size: 15px;
    line-height: 1.6;
    margin-bottom: 24px;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.about-features {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 24px;
    text-align: left;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

.about-feature {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: #f8fafc;
    border-radius: 10px;
}

.about-feature i {
    width: 20px;
    text-align: center;
    color: #0D9488;
    font-size: 16px;
}

.about-feature span {
    font-size: 14px;
    color: #334155;
}

.about-version {
    font-size: 12px;
    color: #94a3b8;
}

.subsection {
    margin-bottom: 28px;
}

.subsection-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    padding-bottom: 6px;
    border-bottom: 1px solid #f1f5f9;
}

.subsection-header h3 {
    font-size: 14px;
    font-weight: 600;
    color: #0D9488;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin: 0;
}

.inline-form {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
}

.inline-form .form-row {
    margin-bottom: 12px;
}

.inline-form .btn {
    width: auto;
}

.empty-text {
    font-size: 13px;
    color: #94a3b8;
    padding: 8px 0;
}

@media (max-width: 480px) {
    .home-container {
        padding: 16px;
        padding-bottom: 80px;
    }

    .transaction-item {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .transaction-actions {
        justify-content: flex-end;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .modal-content {
        border-radius: 16px;
        margin: 10px;
    }

    .modal-header {
        padding: 16px 18px;
    }

    .modal-body {
        padding: 18px;
    }

    .auth-card {
        padding: 28px 20px;
        border-radius: 16px;
    }

    .auth-card.register-card {
        padding: 24px 16px;
    }

    .cartao-item .form-row {
        grid-template-columns: 1fr;
    }

    .buttons-row {
        flex-direction: column;
    }
}

.info-box {
    font-size: 13px;
    color: #475569;
    background: #f8fafc;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    border: 1px solid #e2e8f0;
    line-height: 1.6;
}
.info-box p {
    margin: 0 0 6px;
}
.info-box p:last-child {
    margin-bottom: 0;
}
.info-box ul {
    margin: 0 0 6px;
    padding-left: 20px;
}
.info-box li {
    margin-bottom: 2px;
}
.info-box .info-example {
    font-style: italic;
    font-size: 12px;
    color: #64748b;
}

.help-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #0D9488;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    margin-left: 6px;
    vertical-align: middle;
    line-height: 1;
}
.help-popup {
    position: relative;
    z-index: 100;
}
.help-popup-content {
    position: absolute;
    top: 4px;
    left: 0;
    right: 0;
    background: #1e293b;
    color: #e2e8f0;
    padding: 16px;
    border-radius: 12px;
    font-size: 13px;
    line-height: 1.6;
    box-shadow: 0 8px 32px rgba(0,0,0,0.2);
    max-width: 100%;
}
.help-popup-content p {
    margin: 0 0 8px;
}
.help-popup-content p:last-child {
    margin-bottom: 0;
}
.help-popup-content ul {
    margin: 0 0 8px;
    padding-left: 20px;
}
.help-popup-content li {
    margin-bottom: 4px;
}
.help-popup-content .help-example {
    font-style: italic;
    font-size: 12px;
    color: #94a3b8;
}

.period-selector {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 24px;
    padding: 12px 16px;
    background: #f8fafc;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
}
.period-nav {
    background: none;
    border: none;
    font-size: 18px;
    color: #0D9488;
    cursor: pointer;
    padding: 6px 10px;
    border-radius: 8px;
    transition: background 0.2s;
}
.period-nav:hover {
    background: #f1f5f9;
}
.period-display {
    display: flex;
    gap: 8px;
    align-items: center;
}
.period-display select {
    padding: 8px 12px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    color: #1e293b;
    background: #fff;
    cursor: pointer;
    outline: none;
    transition: border-color 0.2s;
}
.period-display select:focus {
    border-color: #0D9488;
}
