:root {
  --brand: #0f766e;        /* verde azulado CRHogares */
  --brand-dark: #0b5952;
  --brand-light: #14b8a6;
  --sidebar-bg: #0f172a;
  --sidebar-hover: #1e293b;
  --ink: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
  --bg: #f1f5f9;
  --card: #ffffff;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--ink);
}

/* ---------- Layout ---------- */
.app-shell { display: flex; min-height: 100vh; }

.sidebar {
  width: 260px;
  background: var(--sidebar-bg);
  color: #cbd5e1;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; bottom: 0; left: 0;
  z-index: 50;
}
.brand {
  display: flex; align-items: center; gap: 12px;
  padding: 20px 18px;
  border-bottom: 1px solid #1e293b;
}
.brand-mark {
  width: 42px; height: 42px; border-radius: 10px;
  background: linear-gradient(135deg, var(--brand-light), var(--brand));
  color: #fff; font-weight: 800; font-size: 18px;
  display: grid; place-items: center;
}
.brand-name { font-weight: 700; color: #fff; font-size: 16px; }
.brand-sub { font-size: 11px; color: #94a3b8; text-transform: uppercase; letter-spacing: .5px; }

.nav-menu { flex: 1; padding: 12px 10px; overflow-y: auto; }
.nav-section {
  font-size: 11px; text-transform: uppercase; letter-spacing: .6px;
  color: #64748b; padding: 16px 12px 6px;
}
.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; margin: 2px 0;
  border-radius: 8px; color: #cbd5e1; text-decoration: none;
  font-size: 14px; transition: background .15s;
}
.nav-item i { font-size: 17px; width: 20px; text-align: center; }
.nav-item:hover { background: var(--sidebar-hover); color: #fff; }
.nav-item.active { background: var(--brand); color: #fff; font-weight: 600; }

.sidebar-footer { padding: 14px; border-top: 1px solid #1e293b; }
.user-chip { display: flex; align-items: center; gap: 10px; }
.avatar {
  width: 38px; height: 38px; border-radius: 50%;
  background: var(--brand-light); color: #fff;
  display: grid; place-items: center; font-weight: 700;
}
.user-name { color: #fff; font-size: 14px; font-weight: 600; }
.user-role { font-size: 12px; color: #94a3b8; }

.content { flex: 1; margin-left: 260px; min-width: 0; }
.topbar {
  display: flex; align-items: center; gap: 16px;
  padding: 16px 28px; background: #fff;
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 20;
}
.page-title { font-size: 20px; font-weight: 700; margin: 0; }
.topbar-actions { margin-left: auto; display: flex; gap: 8px; }
.page-body { padding: 28px; }

/* ---------- Cards / stats ---------- */
.card { border: 1px solid var(--line); border-radius: 14px; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; }
.stat-card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: 14px; padding: 18px 20px;
}
.stat-card .label { color: var(--muted); font-size: 13px; font-weight: 500; }
.stat-card .value { font-size: 30px; font-weight: 800; margin-top: 4px; }
.stat-card .icon { float: right; font-size: 22px; opacity: .35; }

/* ---------- Tables ---------- */
.table-card { background: #fff; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.table { margin: 0; }
.table thead th { background: #f8fafc; font-size: 12px; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); border-bottom: 1px solid var(--line); }
.table td { vertical-align: middle; }

/* ---------- Badges ---------- */
.chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 600; color: #fff;
}
.tag-pill {
  display: inline-block; padding: 1px 9px; border-radius: 999px;
  font-size: 11px; font-weight: 600; color: #fff; margin: 1px;
}
.priority-dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }

/* ---------- Buttons ---------- */
.btn-brand { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-brand:hover { background: var(--brand-dark); border-color: var(--brand-dark); color: #fff; }
.btn-outline-brand { border-color: var(--brand); color: var(--brand); }
.btn-outline-brand:hover { background: var(--brand); color: #fff; }

/* ---------- Kanban ---------- */
.kanban { display: flex; gap: 16px; overflow-x: auto; padding-bottom: 12px; }
.kanban-col {
  flex: 0 0 300px; background: #eef2f6;
  border-radius: 12px; padding: 10px; min-height: 200px;
}
.kanban-col-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 6px 8px 10px; font-weight: 700; font-size: 14px;
}
.kanban-count { background: #fff; border-radius: 999px; padding: 0 9px; font-size: 12px; color: var(--muted); }
.kanban-card {
  background: #fff; border-radius: 10px; padding: 12px;
  margin-bottom: 8px; border: 1px solid var(--line);
  cursor: grab; box-shadow: 0 1px 2px rgba(0,0,0,.04);
}
.kanban-card:active { cursor: grabbing; }
.kanban-card.dragging { opacity: .5; }
.kanban-col.drop-hover { outline: 2px dashed var(--brand-light); outline-offset: -4px; }
.kanban-card .kc-name { font-weight: 600; font-size: 14px; }
.kanban-card .kc-meta { font-size: 12px; color: var(--muted); margin-top: 3px; }

/* ---------- Auth ---------- */
.auth-wrap {
  min-height: 100vh; display: grid; place-items: center;
  background: linear-gradient(135deg, #0f766e, #0f172a);
  padding: 20px;
}
.auth-card {
  background: #fff; border-radius: 18px; padding: 40px;
  width: 100%; max-width: 400px; box-shadow: 0 25px 60px rgba(0,0,0,.3);
}
.auth-brand { text-align: center; margin-bottom: 24px; }
.auth-brand .brand-mark { width: 60px; height: 60px; font-size: 24px; margin: 0 auto 12px; border-radius: 14px; }

/* ---------- Misc ---------- */
.text-muted-sm { color: var(--muted); font-size: 13px; }
.empty-state { text-align: center; padding: 60px 20px; color: var(--muted); }
.empty-state i { font-size: 46px; opacity: .4; }
a { color: var(--brand); }

@media (max-width: 992px) {
  .sidebar { transform: translateX(-100%); transition: transform .25s; }
  body.sidebar-open .sidebar { transform: translateX(0); }
  .content { margin-left: 0; }
}
