/* =========================================================
   Registro de Horas Laboradas - Tema (inspirado en Luno)
   Primario: #aa46ff | Fondo: #ffffff | Acento: #00f6ff
   ========================================================= */
:root {
  --primary: #aa46ff;
  --primary-dark: #8a2be8;
  --accent: #00f6ff;
  --bg: #ffffff;
  --bg-soft: #f7f5fb;
  --text: #2b2236;
  --text-muted: #7a7488;
  --border: #ece8f3;
  --danger: #ff4d6d;
  --success: #19c37d;
  --radius: 14px;
  --shadow: 0 8px 24px rgba(170, 70, 255, 0.08);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Poppins', 'Segoe UI', system-ui, sans-serif;
  background: var(--bg-soft);
  color: var(--text);
}

a { color: var(--primary); text-decoration: none; }

/* ---------- Login ---------- */
.login-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at top left, #f3e6ff 0%, #ffffff 55%);
}
.login-card {
  width: 100%;
  max-width: 400px;
  background: var(--bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 40px 36px;
  border: 1px solid var(--border);
}
.login-card .brand {
  text-align: center;
  margin-bottom: 24px;
}
.login-card .brand span {
  display: inline-block;
  width: 48px; height: 48px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  margin-bottom: 10px;
}
.login-card h1 { font-size: 1.3rem; margin: 0; }
.login-card p.sub { color: var(--text-muted); font-size: .85rem; margin-top: 4px; }

/* ---------- Forms ---------- */
.form-group { margin-bottom: 18px; }
.form-group label { display: block; font-size: .82rem; font-weight: 600; margin-bottom: 6px; color: var(--text); }
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: .92rem;
  background: var(--bg-soft);
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(170,70,255,.15);
  background: #fff;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  cursor: pointer;
  padding: 11px 20px;
  border-radius: 10px;
  font-weight: 600;
  font-size: .9rem;
  transition: transform .12s, box-shadow .12s, opacity .12s;
}
.btn-primary { background: linear-gradient(135deg, var(--primary), var(--primary-dark)); color: #fff; }
.btn-primary:hover { box-shadow: 0 6px 18px rgba(170,70,255,.35); transform: translateY(-1px); }
.btn-accent { background: var(--accent); color: #023; }
.btn-outline { background: transparent; border: 1px solid var(--border); color: var(--text); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-block { width: 100%; }
.btn-sm { padding: 7px 12px; font-size: .8rem; border-radius: 8px; }

.alert-box { padding: 12px 16px; border-radius: 10px; font-size: .85rem; margin-bottom: 16px; }
.alert-box.error { background: #ffe9ed; color: #b3173a; border: 1px solid #ffc2cf; }
.alert-box.success { background: #e6fbf2; color: #0f8a5c; border: 1px solid #b9f3da; }

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

.sidebar {
  width: 250px;
  background: linear-gradient(180deg, #1b0d2e 0%, #2b1147 100%);
  color: #fff;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  padding: 24px 18px;
}
.sidebar .brand { display: flex; align-items: center; gap: 10px; padding: 0 6px 24px; }
.sidebar .brand .logo-dot { width: 30px; height: 30px; border-radius: 9px; background: linear-gradient(135deg, var(--primary), var(--accent)); }
.sidebar .brand strong { font-size: 1.05rem; }

.nav-section { font-size: .68rem; text-transform: uppercase; letter-spacing: .08em; color: rgba(255,255,255,.45); margin: 18px 8px 8px; }
.sidebar nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  color: rgba(255,255,255,.78);
  font-size: .88rem;
  font-weight: 500;
  margin-bottom: 2px;
}
.sidebar nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.sidebar nav a.active { background: rgba(170,70,255,.25); color: #fff; box-shadow: inset 0 0 0 1px rgba(170,70,255,.5); }
.sidebar .user-box { margin-top: auto; padding-top: 18px; border-top: 1px solid rgba(255,255,255,.1); font-size: .82rem; color: rgba(255,255,255,.85); }
.sidebar .user-box .role-pill { display: inline-block; margin-top: 4px; padding: 2px 9px; border-radius: 20px; background: rgba(0,246,255,.15); color: var(--accent); font-size: .68rem; font-weight: 600; }
.btn-logout { background: transparent; border: 1px solid rgba(255,255,255,.3); color: #fff; }
.btn-logout:hover { background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.5); }

.main {
  flex: 1;
  min-width: 0;
  padding: 28px 36px 60px;
}
.topbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 26px; }
.topbar h1 { font-size: 1.4rem; margin: 0; }
.topbar p { color: var(--text-muted); margin: 2px 0 0; font-size: .85rem; }

.card {
  background: var(--bg);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  padding: 22px;
  margin-bottom: 22px;
}
.card h2 { font-size: 1.05rem; margin: 0 0 16px; }

.kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; margin-bottom: 22px; }
.kpi-card { background: var(--bg); border-radius: var(--radius); border: 1px solid var(--border); padding: 18px 20px; box-shadow: var(--shadow); }
.kpi-card .label { color: var(--text-muted); font-size: .8rem; }
.kpi-card .value { font-size: 1.6rem; font-weight: 700; margin-top: 4px; background: linear-gradient(135deg, var(--primary), var(--accent)); -webkit-background-clip: text; background-clip: text; color: transparent; }

table { width: 100%; border-collapse: collapse; font-size: .87rem; }
table th { text-align: left; color: var(--text-muted); font-weight: 600; padding: 10px 12px; border-bottom: 1px solid var(--border); font-size: .78rem; text-transform: uppercase; letter-spacing: .03em; }
table td { padding: 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
table tr:hover td { background: var(--bg-soft); }

.badge { padding: 3px 10px; border-radius: 20px; font-size: .72rem; font-weight: 600; }
.badge-admin { background: rgba(170,70,255,.12); color: var(--primary); }
.badge-default { background: rgba(0,0,0,.05); color: var(--text-muted); }
.badge-active { background: rgba(25,195,125,.12); color: var(--success); }
.badge-inactive { background: rgba(255,77,109,.12); color: var(--danger); }

.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.toolbar .actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.filter-input { padding: 9px 12px; border: 1px solid var(--border); border-radius: 8px; font-size: .85rem; background: var(--bg-soft); }
.filter-input:focus { outline: none; border-color: var(--primary); }

.modal-overlay { position: fixed; inset: 0; background: rgba(20,8,35,.45); display: none; align-items: center; justify-content: center; z-index: 50; }
.modal-overlay.open { display: flex; }
.modal-box { width: 100%; max-width: 480px; background: #fff; border-radius: var(--radius); padding: 26px; max-height: 88vh; overflow-y: auto; }
.modal-box h3 { margin-top: 0; }
.row-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

.text-muted { color: var(--text-muted); }
.text-right { text-align: right; }

@media (max-width: 920px) {
  .sidebar { display: none; }
  .kpi-grid { grid-template-columns: repeat(2,1fr); }
  .row-grid { grid-template-columns: 1fr; }
}
