:root {
  --bg: #f4f6f8;
  --surface: #ffffff;
  --text: #1f2937;
  --muted: #64748b;
  --line: #dbe3ea;
  --primary: #2563eb;
  --income: #16a34a;
  --expense: #dc2626;
  --warn: #f97316;
  --info: #0284c7;
  --radius: 8px;
  --shadow: 0 12px 30px rgba(15, 23, 42, .08);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.45;
}
a { color: var(--primary); text-decoration: none; }
.app-shell { min-height: 100vh; }
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 20;
  width: 270px;
  padding: 20px;
  background: #111827;
  color: #fff;
  transform: translateX(-100%);
  transition: transform .2s ease;
}
.sidebar.open { transform: translateX(0); }
.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 10;
  background: rgba(15, 23, 42, .4);
}
.sidebar-backdrop.open { display: block; }
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 28px;
  color: #fff;
  font-weight: 800;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: var(--primary);
}
.sidebar nav { display: grid; gap: 6px; }
.sidebar nav a,
.logout {
  display: block;
  padding: 12px 14px;
  border-radius: 8px;
  color: #cbd5e1;
}
.sidebar nav a.active,
.sidebar nav a:hover,
.logout:hover { background: #1f2937; color: #fff; }
.logout { margin-top: 26px; }
.main { min-width: 0; }
.topbar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.topbar h1 { margin: 0; font-size: 22px; }
.topbar p { margin: 2px 0 0; color: var(--muted); }
.icon-btn {
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  cursor: pointer;
}
.content {
  width: min(1220px, 100%);
  margin: 0 auto;
  padding: 18px 14px 36px;
}
.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 22px;
  background: linear-gradient(135deg, #f4f6f8, #e8eef5);
}
.login-card {
  width: min(420px, 100%);
  padding: 28px;
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}
.login-card h1 { margin: 0 0 8px; }
.login-card p { color: var(--muted); margin: 0 0 22px; }
.grid { display: grid; gap: 16px; }
.grid.cards { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.card,
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 8px 18px rgba(15, 23, 42, .04);
}
.card { padding: 18px; }
.card span { color: var(--muted); font-size: 13px; }
.card strong { display: block; margin-top: 8px; font-size: 24px; }
.panel { padding: 18px; margin-top: 18px; }
.panel-header,
.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}
.panel-header h2 { margin: 0; font-size: 18px; }
.filters,
.form-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}
.quick-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}
.sort-link {
  color: inherit;
  font-weight: 800;
}
.profile-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}
.detail-list {
  display: grid;
  gap: 10px;
}
.detail-list div {
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}
.rating {
  color: #f59e0b;
  font-weight: 900;
  letter-spacing: 1px;
}
.form-section {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}
.form-section h2 { margin: 0 0 14px; font-size: 18px; }
label { display: grid; gap: 6px; font-weight: 650; color: #334155; }
input,
select,
textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 9px 11px;
  background: #fff;
  color: var(--text);
  font: inherit;
}
textarea { min-height: 98px; resize: vertical; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 9px 14px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: var(--primary);
  color: #fff;
  font-weight: 750;
  cursor: pointer;
}
.btn.secondary { background: #fff; color: var(--text); border-color: var(--line); }
.btn.danger { background: var(--expense); }
.btn.ok { background: var(--income); }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 760px; }
th,
td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}
th { color: #475569; font-size: 13px; background: #f8fafc; }
.amount.ingreso,
.income { color: var(--income); font-weight: 800; }
.amount.gasto,
.expense { color: var(--expense); font-weight: 800; }
.badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  background: #e2e8f0;
  color: #334155;
}
.badge.ok { background: #dcfce7; color: #166534; }
.badge.danger { background: #fee2e2; color: #991b1b; }
.badge.warn { background: #ffedd5; color: #9a3412; }
.badge.info { background: #e0f2fe; color: #075985; }
.badge.muted { background: #e5e7eb; color: #4b5563; }
.alert {
  padding: 12px 14px;
  border-radius: 8px;
  margin-bottom: 14px;
  background: #e0f2fe;
  color: #075985;
}
.alert.error { background: #fee2e2; color: #991b1b; }
.alert.success { background: #dcfce7; color: #166534; }
.alert.warning { background: #ffedd5; color: #9a3412; }
.inline-form { display: inline; }
.row-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.muted { color: var(--muted); }
.weekly {
  min-width: 980px;
}
.turno-cell {
  display: grid;
  gap: 6px;
  min-width: 120px;
}
.turno-cell strong { font-size: 13px; }
.small { font-size: 13px; }

@media (min-width: 920px) {
  .sidebar {
    transform: none;
  }
  .main {
    margin-left: 270px;
  }
  .menu-toggle {
    display: none;
  }
  .content {
    padding: 26px 26px 46px;
  }
}
