:root {
  --bg: #f4f6f8;
  --card: #fff;
  --text: #1a1a1a;
  --muted: #6b7280;
  --primary: #0066cc;
  --primary-dark: #004999;
  --border: #e5e7eb;
  --accent: #10b981;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--text); }
header {
  display: flex; justify-content: space-between; align-items: center;
  background: #fff; padding: 1rem 2rem; border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: .75rem; }
.brand .logo { font-size: 1.5rem; }
h1 { font-size: 1.1rem; font-weight: 600; }
h2 { font-size: 1.4rem; margin-bottom: 1rem; }
.user { font-size: .9rem; color: var(--muted); display: flex; gap: 1rem; align-items: center; }
.user button { background: none; border: 1px solid var(--border); padding: .25rem .75rem; border-radius: 4px; cursor: pointer; font-size: .85rem; }
main { max-width: 1100px; margin: 2rem auto; padding: 0 1rem; }
.card { background: var(--card); border-radius: 8px; padding: 2rem; box-shadow: 0 1px 3px rgba(0,0,0,.05); }
.cards { list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1rem; }
.cards li { background: var(--card); border-radius: 8px; padding: 1.25rem; cursor: pointer; box-shadow: 0 1px 3px rgba(0,0,0,.05); transition: transform .1s, box-shadow .1s; border: 1px solid transparent; }
.cards li:hover { transform: translateY(-2px); box-shadow: 0 4px 10px rgba(0,0,0,.08); border-color: var(--primary); }
.cards li h3 { font-size: 1rem; margin-bottom: .25rem; }
.cards li .meta { font-size: .85rem; color: var(--muted); }
button.primary { background: var(--primary); color: white; border: none; padding: .75rem 1.5rem; border-radius: 4px; cursor: pointer; font-size: 1rem; }
button.primary:hover { background: var(--primary-dark); }
button.link { background: none; border: none; color: var(--primary); cursor: pointer; padding: .5rem 0; font-size: .9rem; margin-bottom: 1rem; }
.tab { background: none; border: none; padding: .75rem 1.25rem; cursor: pointer; border-bottom: 2px solid transparent; color: var(--muted); }
.tab.active { border-bottom-color: var(--primary); color: var(--text); }
.admin-tabs { display: flex; gap: .5rem; border-bottom: 1px solid var(--border); margin-bottom: 1.5rem; }
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1rem; margin-top: 1.5rem; }
.kpi { background: var(--card); border-radius: 8px; padding: 1.25rem; box-shadow: 0 1px 3px rgba(0,0,0,.05); }
.kpi h4 { font-size: .85rem; color: var(--muted); text-transform: uppercase; margin-bottom: .5rem; letter-spacing: .5px; }
.kpi .v { font-size: 1.75rem; font-weight: 700; color: var(--text); }
.kpi .u { font-size: .9rem; color: var(--muted); margin-left: .25rem; }
.kpi.ahorro .v { color: var(--accent); }
table { width: 100%; border-collapse: collapse; background: var(--card); border-radius: 8px; overflow: hidden; box-shadow: 0 1px 3px rgba(0,0,0,.05); }
th, td { padding: .75rem 1rem; text-align: left; font-size: .9rem; border-bottom: 1px solid var(--border); }
th { background: #f9fafb; font-weight: 600; color: var(--muted); text-transform: uppercase; font-size: .75rem; letter-spacing: .5px; }
.empty { text-align: center; padding: 3rem; color: var(--muted); }
input, select { padding: .5rem .75rem; border: 1px solid var(--border); border-radius: 4px; font-size: .9rem; }
form { display: flex; gap: .5rem; flex-wrap: wrap; align-items: end; margin-bottom: 1rem; }
form label { display: flex; flex-direction: column; gap: .25rem; font-size: .85rem; color: var(--muted); }
.err { background: #fee; color: #c00; padding: .75rem 1rem; border-radius: 4px; margin-bottom: 1rem; }
