* { box-sizing: border-box; }
:root {
    --bg: #f4f6f8;
    --card: #ffffff;
    --text: #1a2332;
    --muted: #5c6b7a;
    --line: #dde3ea;
    --brand: #0f4c5c;
    --brand-light: #1b7a8c;
    --accent: #f4a261;
    --danger: #c1121f;
    --success: #2a9d8f;
    --warning: #e9c46a;
    --shadow: 0 10px 30px rgba(15, 76, 92, 0.08);
    --radius: 14px;
}
body {
    margin: 0;
    font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
    background: linear-gradient(180deg, #eef3f6 0%, var(--bg) 220px);
    color: var(--text);
    min-height: 100vh;
}
a { color: var(--brand-light); text-decoration: none; }
a:hover { text-decoration: underline; }
.topbar {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 1rem 1.5rem;
    background: var(--brand);
    color: #fff;
    flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: .75rem; }
.brand-mark {
    width: 42px; height: 42px; border-radius: 10px;
    background: var(--accent); color: var(--brand);
    display: grid; place-items: center; font-weight: 800;
}
.brand small { display: block; opacity: .8; font-size: .75rem; }
.nav { display: flex; gap: .5rem; flex: 1; flex-wrap: wrap; }
.nav a {
    color: #fff; padding: .45rem .8rem; border-radius: 999px;
    text-decoration: none; opacity: .85;
}
.nav a.active, .nav a:hover { background: rgba(255,255,255,.15); opacity: 1; text-decoration: none; }
.user-menu { display: flex; align-items: center; gap: .75rem; font-size: .9rem; }
.container { max-width: 1180px; margin: 0 auto; padding: 1.5rem; }
.footer { text-align: center; color: var(--muted); padding: 2rem 1rem; font-size: .85rem; }
.card {
    background: var(--card); border: 1px solid var(--line);
    border-radius: var(--radius); box-shadow: var(--shadow);
    padding: 1.25rem; margin-bottom: 1rem;
}
.grid { display: grid; gap: 1rem; }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.stat-label { color: var(--muted); font-size: .85rem; margin-bottom: .35rem; }
.stat-value { font-size: 1.6rem; font-weight: 700; }
.stat-value.positive { color: var(--success); }
.stat-value.negative { color: var(--danger); }
.page-header {
    display: flex; justify-content: space-between; align-items: center;
    gap: 1rem; margin-bottom: 1rem; flex-wrap: wrap;
}
.page-header h1 { margin: 0; font-size: 1.6rem; }
.btn {
    display: inline-flex; align-items: center; justify-content: center;
    padding: .55rem 1rem; border-radius: 10px; border: none;
    background: var(--brand-light); color: #fff; font-weight: 600;
    cursor: pointer; text-decoration: none;
}
.btn:hover { filter: brightness(1.05); text-decoration: none; }
.btn-ghost { background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.25); }
.btn-secondary { background: #fff; color: var(--brand); border: 1px solid var(--line); }
.btn-danger { background: var(--danger); }
table { width: 100%; border-collapse: collapse; }
th, td { padding: .75rem .5rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { color: var(--muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; }
.amount-income { color: var(--success); font-weight: 600; }
.amount-expense { color: var(--danger); font-weight: 600; }
.badge {
    display: inline-block; padding: .2rem .55rem; border-radius: 999px;
    font-size: .75rem; font-weight: 600;
}
.badge-active { background: #d8f3dc; color: #1b4332; }
.badge-bidding { background: #fff3cd; color: #664d03; }
.badge-on_hold { background: #e2e3e5; color: #41464b; }
.badge-completed { background: #cfe2ff; color: #084298; }
.badge-closed { background: #f8d7da; color: #842029; }
.form-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
label { display: block; font-size: .85rem; color: var(--muted); margin-bottom: .35rem; }
input, select, textarea {
    width: 100%; padding: .65rem .75rem; border: 1px solid var(--line);
    border-radius: 10px; font: inherit; background: #fff;
}
textarea { min-height: 110px; resize: vertical; }
.alert { padding: .85rem 1rem; border-radius: 10px; margin-bottom: 1rem; }
.alert-success { background: #d8f3dc; color: #1b4332; }
.alert-error { background: #f8d7da; color: #842029; }
.login-wrap {
    min-height: calc(100vh - 80px);
    display: grid; place-items: center; padding: 2rem 1rem;
}
.login-card { width: min(420px, 100%); }
.login-card h1 { margin-top: 0; }
.muted { color: var(--muted); }
.bar-list { list-style: none; padding: 0; margin: 0; }
.bar-list li {
    display: grid; grid-template-columns: 1fr auto; gap: .5rem;
    align-items: center; margin-bottom: .75rem;
}
.bar-track {
    grid-column: 1 / -1; height: 8px; background: #edf2f7;
    border-radius: 999px; overflow: hidden;
}
.bar-fill { height: 100%; background: linear-gradient(90deg, var(--brand), var(--brand-light)); }
@media (max-width: 700px) {
    .topbar { flex-direction: column; align-items: flex-start; }
    .user-menu { width: 100%; justify-content: space-between; }
    table { font-size: .9rem; }
}
