/* ============================================================
   app.css – FinWise Platform v1.0
   ============================================================ */

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: #f1f5f9; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

main { animation: fadeUp 180ms ease both; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

.spinner { border: 3px solid #e2e8f0; border-top-color: #10b981; border-radius: 50%; width: 24px; height: 24px; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.card-hover { transition: transform 180ms ease, box-shadow 180ms ease; }
.card-hover:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,.08); }

/* Buttons */
.btn-primary {
    display: inline-flex; align-items: center; gap: .5rem;
    padding: .5rem 1.125rem;
    background: #059669; color: #fff;
    font-weight: 600; font-size: .875rem;
    border-radius: .5rem; border: none; cursor: pointer;
    transition: background .15s, box-shadow .15s;
    text-decoration: none; white-space: nowrap;
}
.btn-primary:hover { background: #047857; box-shadow: 0 4px 12px rgba(5,150,105,.3); }

.btn-accent {
    display: inline-flex; align-items: center; gap: .5rem;
    padding: .5rem 1.125rem;
    background: #2563eb; color: #fff;
    font-weight: 600; font-size: .875rem;
    border-radius: .5rem; border: none; cursor: pointer;
    transition: background .15s; text-decoration: none; white-space: nowrap;
}
.btn-accent:hover { background: #1d4ed8; }

.btn-ghost {
    display: inline-flex; align-items: center; gap: .5rem;
    padding: .5rem 1.125rem;
    background: transparent; color: #374151;
    font-weight: 600; font-size: .875rem;
    border-radius: .5rem; border: 1.5px solid #e5e7eb; cursor: pointer;
    transition: all .15s; text-decoration: none; white-space: nowrap;
}
.btn-ghost:hover { background: #f9fafb; border-color: #d1d5db; }

.btn-danger {
    display: inline-flex; align-items: center; gap: .5rem;
    padding: .5rem 1.125rem;
    background: #dc2626; color: #fff;
    font-weight: 600; font-size: .875rem;
    border-radius: .5rem; border: none; cursor: pointer;
    transition: background .15s; text-decoration: none; white-space: nowrap;
}
.btn-danger:hover { background: #b91c1c; }

.btn-sm { padding: .375rem .75rem; font-size: .8rem; }

.icon-btn {
    display: inline-flex; align-items: center; justify-content: center;
    height: 2rem; width: 2rem; border-radius: .5rem;
    background: transparent; border: none; cursor: pointer;
    transition: background .15s; text-decoration: none; color: inherit;
}
.icon-btn:hover { background: #f3f4f6; }

/* Form Fields */
.field-label { display: block; font-size: .8125rem; font-weight: 600; color: #374151; margin-bottom: 6px; }
.field-input {
    display: block; width: 100%;
    padding: .625rem .75rem;
    border: 1.5px solid #e5e7eb; border-radius: .5rem;
    font-size: .875rem; color: #111827; background: #fff;
    outline: none; transition: border-color .15s, box-shadow .15s;
    box-sizing: border-box;
}
.field-input:focus { border-color: #10b981; box-shadow: 0 0 0 3px rgba(16,185,129,.12); }
.field-input::placeholder { color: #d1d5db; }
textarea.field-input { resize: vertical; }
select.field-input { cursor: pointer; }

/* Badges */
.badge { display: inline-flex; align-items: center; font-size: .6875rem; font-weight: 600; padding: .2rem .6rem; border-radius: 9999px; }
.badge-green  { background: #dcfce7; color: #15803d; }
.badge-red    { background: #fee2e2; color: #b91c1c; }
.badge-amber  { background: #fef3c7; color: #b45309; }
.badge-blue   { background: #dbeafe; color: #1d4ed8; }
.badge-gray   { background: #f3f4f6; color: #4b5563; }
.badge-purple { background: #ede9fe; color: #6d28d9; }
.badge-orange { background: #ffedd5; color: #c2410c; }
.badge-teal   { background: #ccfbf1; color: #0f766e; }

/* Tables */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.th-cell { padding: .75rem 1rem; text-align: left; font-size: .75rem; font-weight: 600; color: #6b7280; text-transform: uppercase; letter-spacing: .05em; }
.td-cell { padding: .75rem 1rem; }

/* Priority pills */
.priority-essential { display: inline-flex; font-size: .6875rem; font-weight: 700; padding: .15rem .6rem; border-radius: 9999px; background: #fee2e2; color: #b91c1c; }
.priority-important { display: inline-flex; font-size: .6875rem; font-weight: 600; padding: .15rem .6rem; border-radius: 9999px; background: #ffedd5; color: #c2410c; }
.priority-optional  { display: inline-flex; font-size: .6875rem; font-weight: 500; padding: .15rem .6rem; border-radius: 9999px; background: #f3f4f6; color: #6b7280; }

/* Progress bar */
.progress-bar { height: 8px; border-radius: 4px; background: #e5e7eb; overflow: hidden; }
.progress-fill { height: 100%; border-radius: 4px; transition: width .5s ease; }

/* Finance status colors */
.status-paid    { color: #15803d; }
.status-pending { color: #b45309; }
.status-overdue { color: #b91c1c; }

/* Card with colored left border */
.card-accent-left { border-left: 4px solid; }

/* Modal backdrop */
[data-modal-backdrop] { backdrop-filter: blur(2px); }

/* AI response markdown */
.ai-response h2 { font-size: 1.1rem; font-weight: 700; margin: 1rem 0 .5rem; color: #111827; }
.ai-response h3 { font-size: 1rem; font-weight: 600; margin: .8rem 0 .4rem; color: #374151; }
.ai-response p { margin: .4rem 0; line-height: 1.6; }
.ai-response ul, .ai-response ol { margin: .4rem 0 .4rem 1.5rem; }
.ai-response li { margin: .2rem 0; }
.ai-response strong { font-weight: 700; color: #111827; }

/* Money colors */
.money-positive { color: #15803d; }
.money-negative { color: #b91c1c; }
.money-neutral  { color: #6b7280; }

/* Pulse animation for alerts */
.pulse-dot { width: 8px; height: 8px; border-radius: 50%; animation: pulse 2s infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .4; } }

/* Tab styles */
.tab-item { padding: .5rem 1rem; font-size: .875rem; font-weight: 500; color: #6b7280; border-bottom: 2px solid transparent; cursor: pointer; transition: all .15s; text-decoration: none; display: inline-block; }
.tab-item:hover { color: #059669; }
.tab-item.active { color: #059669; border-bottom-color: #059669; font-weight: 600; }

.line-clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
